"""This module handle the Cibynet Gmail account and provide useful methods
to manipulate it.
"""



try:
  import libgmail
except:
  pass


def send(body, to, subject="[CibyNet]"):
  """Send an email using the Cibynet Gmail account.
  
  Arguments:
    - body: a string or unicode.
    - to: User object to which you wish to send the email.
    - subject: string or unicode, the subject of the email to send.
  """
  # XXX: it's a mess to make libgmail work with http proxy
  msg = libgmail.GmailComposedMessage(to.nice_email, subject, body)
  # todo: change the password
  ga = libgmail.GmailAccount('cibynet', 'password')
  